using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class InBoundMap : EntityTypeConfiguration<InBound>
	{
		public InBoundMap()
		{
			// Primary Key
			this.HasKey(t => t.InBoundId);

			// Properties
			this.Property(t => t.CustomerBatchNO)
				.HasMaxLength(20);
				
			this.Property(t => t.IntoStationType)
				.IsRequired()
				.HasMaxLength(20);
				
			this.Property(t => t.DeliveryCarNO)
				.HasMaxLength(20);
				
			// Table & Column Mappings
			this.ToTable("InBound");
			this.Property(t => t.InBoundId).HasColumnName("InBoundId");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.CustomerBatchNO).HasColumnName("CustomerBatchNO");
			this.Property(t => t.InBoundNO).HasColumnName("InBoundNO");
			this.Property(t => t.FromStation).HasColumnName("FromStation");
			this.Property(t => t.Operator).HasColumnName("Operator");
			this.Property(t => t.IntoTime).HasColumnName("IntoTime");
			this.Property(t => t.IntoStation).HasColumnName("IntoStation");
			this.Property(t => t.IntoStationType).HasColumnName("IntoStationType");
			this.Property(t => t.DeliveryMan).HasColumnName("DeliveryMan");
			this.Property(t => t.DeliveryTime).HasColumnName("DeliveryTime");
			this.Property(t => t.DeliveryDriver).HasColumnName("DeliveryDriver");
			this.Property(t => t.DeliveryCarNO).HasColumnName("DeliveryCarNO");
			this.Property(t => t.IsPrint).HasColumnName("IsPrint");
			this.Property(t => t.PrintTime).HasColumnName("PrintTime");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreatStation).HasColumnName("CreatStation");
			this.Property(t => t.CreatTime).HasColumnName("CreatTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateStation).HasColumnName("UpdateStation");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.ToStation).HasColumnName("ToStation");
		}
	}
}

